 @include "wilcoxon.awk"
 function Wilcoxon() {
       print "1,  1 " Wilcoxon1(1,1)
       print "0.5,1 " Wilcoxon1(0.5,1)
       print "2,  1 " Wilcoxon1(2,1)
       print "1,  0 " Wilcoxon1(1,0)
       print "0.5,0 " Wilcoxon1(0.5,0)
       print "2,  0 " Wilcoxon1(2,0)
 }
 function Wilcoxon1(mult,up,       pop1,pop2,out,i) {
       mult= mult ? mult : 1
       p2a("1 78 2 24 3 64 " \
	   "4 45 5 64 6 52 "  \
	   "7 30 8 50 9 64 "   \
	   "10 50 11 78 12 22 "	\
	   "13 84 14 40 15 90 "	\
	   "16 72" ,pop1, " ")
       p2a("1 78 2 24 3 62 " \
	   "4 48 5 68 6 56 "  \
	   "7 25 8 44 9 56 "   \
	   "10 40 11 68 12 36 "	\
	   "13 68 14 20 15 58 "	\
	   "16 32",pop2," ")
       for(i in pop1) pop1[i] *= mult
       out = wilcoxon(pop1,pop2,up,criticalValue(95))
       if (out == 0)
	   		return "tie"
       else if (out > 0)
	   		return "win for a"
       else if (out < 0)
	   		return "loss for a"
 }

